from fastapi import FastAPI
from fastapi.security import OAuth2PasswordBearer
from fastapi.middleware.cors import CORSMiddleware

from controller.ai.equipment import ai_router_equipment
from controller.ai.health import ai_router
from controller.ai.report import ai_report_router
from controller.health_controller import health_router
from controller.l16_contoller import l16_router
from controller.location_controller import location_router
from controller.s8_controller import s8_router
from controller.work_controller import work_router

app = FastAPI()
app.include_router(ai_router)
app.include_router(l16_router)
app.include_router(s8_router)
app.include_router(health_router)
app.include_router(location_router)
app.include_router(work_router)
app.include_router(ai_report_router)
app.include_router(ai_router_equipment)

# 配置 CORS 中间件
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_methods=["*"],
    allow_headers=["*"],
)
